package model;

import java.io.Serializable;

public abstract class Person implements Serializable {
	private static int maxID = 0;

    protected String name;
    protected String firstName;
    protected int id;
    protected String pseudo;
    protected String pass;
    protected String type;
	
	public Person(String name, String firstName, String pseudo, String pass, String type) {
		this.name = name;
		this.firstName = firstName;
		this.pseudo = pseudo;
		this.pass = pass;
		this.type = type;
		this.id = Person.maxID++;
	}
	
	public boolean equals(Person p) {
		return this.id == p.id;
	}
	
	@Override
	public String toString() {
		return this.name + " " + this.firstName;
	}

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @return the firstName
     */
    public String getFirstName() {
        return firstName;
    }

    /**
     * @return the id
     */
    public int getId() {
        return id;
    }

    /**
     * @return the pseudo
     */
    public String getPseudo() {
        return pseudo;
    }

    /**
     * @return the pass
     */
    public String getPass() {
        return pass;
    }

	/**
	 * @return the type
	 */
	public String getType() {
		return type;
	}
	
	public void setPass(String pass) {
		this.pass = pass;
	}
}
